<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>

<link href="/res/third/bootstrap3/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
 
<script src="/res/common/js/jquery.1.9.1.min.js" type="text/javascript"></script>
<script src="/res/third/artDialog/jquery.artDialog.js" type="text/javascript"></script>
<script src="/res/third/validate/jquery.validate.js" type="text/javascript"></script>

<script type="text/javascript">

function addHotProduct(){
	top.addTempTab("/hot_floor/addhotproduct.do");
}

function manageProduct(){
	top.addTempTab("/hot_floor/managehotproduct.do");
}
function deleteHotProduct(id){
    var con=confirm("是否删除");
    if(con){
        $.ajax({
            type:"post",
            dataType:"json",
            url:"/hot_floor/deletehotproduct.do",
            data:{id:id},
            success:function(aj){
                if(aj.success){
                    location.reload();
                    alert(aj.msg);
                }
            }
		});
	}
}

function sousuo(){
	   $("#soform").submit();
}

$(function () {
    $(".button_modify").click(function(){
        var id = $(this).attr("data-id");
		top.addTempTab("/hotfloor/modify_hot_product.do?id="+id);
    });
});

</script>
 
</head>
<body>
    <div class="panel panel-info panel-content">
      <div class="panel-heading" style="position: relative;">
			
			<form id="soform" method="post">
				<table>
					<tr>
						<td class="w150 ">
							<input type="text" class="form-control"  name="so_productName"  placeholder="输入商品名称搜索">
						</td>
						<td class="w80" style="padding-top: 5px;">
							<select>
							   <option>未生效</option>
							   <option>已失效</option>
							   <option>已生效</option>
							</select>
						</td>
						
						<td style="padding-left: 10px">
							<div class="input-group">
								<span class="input-group-btn" style="border: 1px solid #ddd;">
									<button class="btn btn-default" type="button" onclick="sousuo()">搜索</button>
								</span>
							</div>
						</td>
						<td style="padding-left: 177px;font-size: 16px;font-family: inherit;color: inherit;">
							<input type="button" class="btn btn-info"  onclick="addHotProduct()"     value="+添加爆品">
							<input type="button" class="btn btn-info"  onclick="manageProduct()"     value="管理首页爆品">
						</td>
					</tr>
				  </table>
				</form>
		</div>
      
      <table class="table table-hover table-bordered table-striped table-condensed">
         <tr>
           <th>所在楼层</th>
           <th>所属类目</th>
           <th>商品名称</th>
           <th>会员价</th>
           <th>爆品价</th>
           <th>有效期</th>
           <th>更新时间</th>
           <th>操作</th>
         </tr>
         [#list getHotFloorList as getHotFloor]
         <tr>
			 <input type="hidden" name="id">
            <td align="center">${getHotFloor.floor!}</td>
            <td align="center">${getHotFloor.categoryName!}</td>
            <td align="center">${getHotFloor.productName!}</td>
            <td align="center">${getHotFloor.memberPrice!}</td>
            <td align="center">${getHotFloor.hotPrice!}</td>
            <td align="center">[#if getHotFloor.starttime??]${getHotFloor.starttime?string("yyyy-MM-dd")!}[/#if]~[#if getHotFloor.endtime??]${getHotFloor.endtime?string("yyyy-MM-dd")!}[/#if]</td>
            <td align="center">${getHotFloor.updatetime?string("yyyy-MM-dd")!}</td>
            <td align="center">
                <input type="button" value="修改" data-id="${getHotFloor.id!}" class="btn-info button_modify" >
                <input type="button" onclick="deleteHotProduct('${getHotFloor.id}')" value="删除" class="btn-info" >
            </td>
         </tr>
         [/#list]
      </table>  
      </div>
      
</body>
</html>
